﻿<ion-view view-title="数据模型" hide-nav-bar="{{$root.dingMobile.hideHeader}}">
    <ion-nav-bar class="bar-calm">
        <ion-nav-buttons side="left">
            <button class="button button-icon button-clear ion-ios-arrow-back" ng-click="back();">返回</button>
        </ion-nav-buttons>
    </ion-nav-bar>
    <div class="ng-hide animated fadeIn scrollTop" ng-show="displayTop" ng-click="scrollTop()">
        <i class="icon ion-arrow-up-a"></i>
    </div>

    <ion-content class="scroll-content ionic-scroll" on-scroll="getScrollPosition();">
        <ion-refresher on-refresh="loadMoreData('refresh')">
        </ion-refresher>
        <ion-list>
            <ion-item class="item-icon-right" style="cursor:pointer"
                      ng-repeat="Data in  DataModelData"
                      ng-click="openItem('{{Data.InstanceId}}')">
                <div>
                    <h2 ng-bind="Data.Name"></h2>
                    <i class="icon ion-chevron-right icon-accessory"></i>
                </div>
            </ion-item>
            <ion-item ng-if="DataModelData.length > 0 && loadCompleted && !exception"
                      style="cursor:pointer">
                <div class="item-icon-left" style="padding-left:20px;">
                    <i class="icon ion-android-happy"></i>
                    <h2 style="margin-left:10px;">全部加载完成</h2>
                </div>
            </ion-item>
            <ion-item ng-if="NoThisWebPart"
                      style="cursor:pointer">
                <div class="item-icon-left" style="padding-left:20px;">
                    <i class="icon ion-android-sad"></i>
                    <h2 style="margin-left:10px;">该数据模型不存在</h2>
                </div>
            </ion-item>
            <ion-item ng-if="exception"
                      style="cursor:pointer">
                <div class="item-icon-left" style="padding-left:20px;">
                    <i class="icon ion-information-circled"></i>
                    <h2 style="margin-left:10px;">系统数据加载失败，请稍候再试！</h2>
                </div>
            </ion-item>
        </ion-list>
        <ion-infinite-scroll ng-if="!loadCompleted"
                             icon="ion-loading-c"
                             distance="10%"
                             on-infinite="loadMoreData()">
        </ion-infinite-scroll>
    </ion-content>
</ion-view>